<?php
class Des
{
    /**
     * UTF8字符串加密
     * @param string $string
     * @author Anyon <zoujingli@qq.com>
     * @date 2017/06/26
     * @return string
     */
    static function encode($string) {
        $chars = '';
        $len = strlen($string = iconv('utf-8', 'gbk', $string));
        for ($i = 0; $i < $len; $i++) {
            $chars .= str_pad(base_convert(ord($string[$i]), 10, 36), 2, 0, 0);
        }
        return strtoupper($chars);
    }
    /**
     * UTF8字符串解密
     * @param string $string
     * @author Anyon <zoujingli@qq.com>
     * @date 2017/06/26
     * @return string
     */
    static function decode($string) {
        $chars = '';
        foreach (str_split($string, 2) as $char) {
            $chars .= chr(intval(base_convert($char, 36, 10)));
        }
        return iconv('gbk', 'utf-8', $chars);
    }
  }

$str = '2R2P382T2N2X2S1P1D1H1C122R2X383D2N2X2S1P1H1E1239372T362N2X2S1P1H1H1F1E1C1C1F1D';
var_dump(Des::decode($str));
